<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class GoodsExchange extends Model
{
    protected $guarded = [];

    public $timestamps = false;

    protected $fillable = ['goods_id', 'sku_id', 'score', 'start_time', 'end_time'];

    protected $appends = ['time'];

    public function getTimeAttribute()
    {
        return [
            0 => date('Y-m-d', strtotime($this->start_time)),
            1 => date('Y-m-d', strtotime($this->end_time))
        ];
    }

}
